package com.zhiwen.test;

/**
 * @Auther: wuzhiwen
 * @Date: 2018/11/13 13:45
 * @Description:
 */
public class YuanSuanFuDemo {

    public static void main(String[] args) {
        demo02();
//        demo01();
//        int number = 12222222222;
//        System.out.println((long)12222222222L >>> 1);
//        System.out.println(1222222222*10 >>> 1);

    }

    public static void demo01() {
        int number = 10;
        number = number >> 1;
        System.out.println(number);
        number = number << 1;
        System.out.println(number);
        number = number >>> 1;
        System.out.println(number);
    }

    public static void demo02() {
        System.out.println(9 & ((2 << 1) - 1));
        System.out.println(2 << 1);
        int number = -1;
        System.out.println(number >> 1);
        System.out.println(number << 1);
        System.out.println(number >>> 1);
    }

}
